const { Schema, model } = require('mongoose');
const moment = require('moment')
const parkingsSchema = new Schema({
    address: String,
    number: String,
    property: String,
    cycle: String,
    price: String,
    state: {
        type: String,
        default: 1,
    },
    time: {
        type: String,
        default: moment().format('YYYY/MM/DD HH:mm')
    },
    lessorsId: {
        type: Schema.Types.ObjectId,
        ref: "lessorsModel"
    }
    //定义好名称后数据库定义名称要一样

})

const parkingsModel = model('parkingsModel', parkingsSchema, 'parkings')
module.exports.parkingsModel = parkingsModel



